package com.fita.admin.service.order;

import com.demo2do.core.entity.page.Page;
import com.demo2do.core.persistence.support.QueryFilter;
import com.fita.admin.entity.search.order.OrderSearch;
import com.fita.admin.entity.security.Login;
import com.fita.admin.service.DataService;
import com.fita.entity.order.Order;
import com.fita.entity.order.OrderComponent;
import com.fita.entity.order.OrderStatus;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * 
 * @author 宋剑宏
 *
 */
public interface OrderService extends DataService<Order> {

    /**
     * @param login
     * @param status
     * @return
     */
    public int count(Login login, OrderStatus status);

    /**
     * @param login
     * @param status
     * @param page
     * @return
     */
    public List<Order> list(Login login, OrderStatus status,Page page);
	
	/**
	 * 
	 * @param search
	 * @return
	 */
	public int count(OrderSearch search);
	
	/**
	 * 
	 * @param search
	 * @param with
	 * @return
	 */
	public List<Order> search(OrderSearch search, Page with);
	
	/**
	 * 
	 * @param id
	 * @param loginId
     * @throws ParseException
	 */
	public void pay(Long id, OrderComponent orderComponent, Long loginId) throws ParseException;
	
	/**
	 * 
	 * @param id
	 */
	public void consumed(Long id);
 	
	/**
	 * 
	 * @param id
	 */
	public void cancel(Long id);
	
	/**
	 * 
	 * @param id
	 */
	public void refunded(Long id);

	/**
	 * 
	 * @param order
	 * @return
	 */
	public Map<String, Object> generateCancel(Order order);

    /**
     * @param login
     * @param class1
     * @param preparedFilter
     * @return
     */
    public int count(Login login, Class<Order> class1, QueryFilter preparedFilter);

    /**
     * @param login
     * @param class1
     * @param search
     * @param with
     * @return
     */
    public List<Order> search(Login login, Class<Order> class1, OrderSearch search, Page with);

}
